import { Router, Route, Switch, Redirect } from 'react-router-dom'
import { customHistory } from './utiles'
import AuthRoute from './components/AuthRoute'
import GeekLayout from '@/pages/GeekLayout'
import Login from '@/pages/Login'
import NotFound from './pages/NotFound'
import './App.scss'

function App() {
  return (
    <Router history={customHistory}>
      <div className="App">
        <Switch>
          <Route
            exact
            path="/"
            render={() => <Redirect to="/home"></Redirect>}
          />
          <AuthRoute path="/home" component={GeekLayout} />
          <Route path="/login" component={Login} />
          <Route path="/not" component={NotFound} />
        </Switch>
      </div>
    </Router>
  )
}

export default App
